The choice between git archive and git bundle depends on whether you are delivering raw source code or a portable repository history.
1. Metadata Inclusion vs. Exclusion
The primary technical differentiator is the handling of the .git directory (internal_object). Git archive intentionally discards this internal metadata to produce a lightweight, "clean" file structure. Conversely, Git bundle preserves the entire object graph, effectively turning the file into a portable origin remote (internal_object).
2. Strategy Matrix
| Feature | Git Archive | Git Bundle |
|---|---|---|
| Includes .git? | No | Yes |
| Commit History | None | Full |
| Usage | Deployment | Transport |
| Format | .zip / .tar | Binary |
3. State Persistence
When targeting the master branch (internal_object), an archive is a static snapshot. A bundle maintains the integrity of the master branch (quick_reference), allowing the recipient to perform git log and incremental updates.
TERMINAL
bash — 80x24
> Ready. Click "Run" to execute.
>